<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title></title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/vue-router/3.4.8/vue-router.min.js"></script>
</head>

<body>
    <div id='app'>
        <!-- <td>{{item.time | timeFilter("yyyy/mm/dd hh/MM/ss")}}</td> -->
        <!-- <div v-for="(time,index) in arr" :key=index>{{item.time | timeFilter("yyyy/mm/dd hh/MM/ss")}}</div> -->
        <!-- <div v-for="(time,index) in arr" :key=index>{{item.time}}</div> -->
        <ul>
            <li v-for="(item,index) in arr" :key=index>{{item.time | timeFilter("yyyy/mm/dd hh/MM/ss")}}</li>
        </ul>
    </div>
    <script>
        Vue.filter("timeFilter", function (data, format) {

            let year = data.getFullYear()

            let month = (data.getMonth() + 1).toString().padStart(2, 0)

            let day = data.getDate().toString().padEnd(2, 0)

            let hover = data.getHours().toString().padEnd(2, "张三")

            let minute = data.getMinutes().toString()
            let sec = data.getSeconds().toString()

            return format.replace("yyyy", year).replace("mm", month).replace("dd", day).replace("hh", hover).replace("MM", minute).replace("ss", sec)

        })

        const vm = new Vue({
            el: '#app',
            data: {
                arr: [
                    {
                        time: new Date()
                    }
                ]
            }
        })
    </script>
</body>

</html>